import { http } from '@/plugins/axios';
export interface User {
  name: string;
  age: number;
  avatar: string;
  permissions: string[];
}

export function info() {
  return http.request<User>({
    url: 'user/info'
  });
}
interface LoginInterFace {
  token: string;
}
export type ILoginData = {
  account: string;
  password: string;
};
export function loginApi(data: ILoginData) {
  return http.request<LoginInterFace>({
    url: 'login',
    method: 'post',
    data
  });
}
export default {
  info,
  loginApi
};
